Adjust System time via SNTP

         (server version 4.17 or later)

Overview

MOMI has the capability to adjust the Nonstop System time via a Network time source.

 

This feature is not enabled by default.

 

A Network Time Protocol (NTP) server is specified to MOMI and this server queried periodically using the Simple Network Time Protocol (SNTP).  SNTP is defined in RFC 2030 and  MOMI specifies version 3 in the time request.  This protocol provides a simplified means for obtaining time from a reliable source located either on the local network or via the Internet .  NTP servers usually obtain their time from master sources such as atomic clocks or from over-the-air sources such as GPS.

 

How it works

MOMI queries or takes many samples from the NTP server over several minutes.  The samples are processed to determine a network time.  The network time is compared to the time on the Nonstop System to determine if an adjustment forward or backward is required.  The Operating System call SETSYSTEMCLOCK is used to perform the adjustment and is given 1) the amount to adjust and 2)  a mode of 6 which directs a clock adjustment (not a clock set) regardless of the clock error.

 

The Nonstop Operating System provides two methods for manipulating the System time.  The first method is to set the clock to a specific time, which could be an abrupt operation and is not generally performed with a 'live' System.  The second method is to adjust the rate at which the clock operates without disturbing the live environment.  MOMI uses the second method by default.

 

A way to think of the clock adjustment is that it is "nudged" either forward or backward by slightly speeding up or slightly slowing down the System clock, but not jumping or forcing it to a specific time.  Nudging may be performed on an active system without concern for setting the clock backward, which certain subsystems such as TMF could not tolerate (or at least really not like).

 

A side effect of clock "nudging" is that if the System is off by more that a few minutes, particularly if the system is ahead of the network source, it may take some time (no pun intended) before an accurate time is available. If the System time is really 'off', a manual operation should be considered during a maintenance window.  

 

Should I use it?

The SNTP protocol and the MOMI implementation does not the provide the highest level of accuracy theoretically possible, but can in most situations maintain the System time much better than manual input.  The code implementation strives for an accuracy of .001 seconds, this is the smallest adjustment attempted, but a resulting accuracy of about 0.1 seconds is recommended for "should I use it" purposes.  However, if any of the following are true:

 

  1. Operating System is less than G06.23 (a bug was fixed in T9050APH with SETSYSTEMCLOCK), or
  2. higher level of accuracy is required, or
  3. minor fluctuations cannot be tolerated, or
  4. System time management is critical

 

then this feature of MOMI should not be enabled.

 

Systems that are just plain "slow" and are constantly behind, may be closer to the network source as a result of MOMI requesting time adjustments, but may still remain behind.  

 

What is the best time source?

Ideally, a local NTP server/device on your Network would provide the highest levels of accuracy.  Hopefully, the local network has far less traffic and response time fluctuations than a remote device accessed via the Internet.

 

A local device may be a dedicated NTP server, a Windows Server or a UNIX Server.  A Windows Server must be a domain controller or otherwise have the NTP server function enabled.

 

A public time server (NTP) may be used by searching on an Internet search engine or from the following URL http://www.pool.ntp.org/

 

Network information

SNTP uses a UDP socket over port 123.  A MOMI server on the NonStop System opens the socket and sends a time request.  The response is received over the same socket and port.  It may be necessary to have your firewall (i.e. network environment) allow this outbound request.

 

How to activate

The System time management feature of MOMI may be placed in a 'preview' mode prior to full activation.

 

The preview mode allows confirmation of access to an NTP server and the time difference between Nonstop System and the NTP server are logged to the MOMI Log.  The first three steps below place MOMI in the preview mode and the fourth step allows adjustment of the System clock:  

 

  1. determine the NTP server to use.  

 

  1. add the following keywords to the CONFMOMI file (restart MOMI to take effect):

 

                                        == specify TCP/IP stack name

SNTP-TCPIP-NAME  <tcpip-process-name>   ==  (not always needed)

 

SNTP-SERVER-ADDR <DNS-name> | <IP-address>       == NTP server

 

  1. bring up the MOMI Log to see the difference between the System time and the Network Source (the messages are logged once an hour by default).   

 

  1. if desired, direct MOMI to perform required adjustments to the System clock by adding the following keyword to the CONFMOMI file (restart MOMI to take effect):

 

                                                == allow MOMI to adjust

SNTP-ALLOW-ADJUSTMENT                   ==  the System time

 

Common questions

Can our operators still set the System time if MOMI is configured to make adjustments?

 

Yes, with a consideration.  The operating system forces a set of the system clock under two situations.  1) a SETTIME is performed twice within two minutes, or 2) the SETTIME value specifies a time two minutes or more off from the current System time.  If the operator only issues a single SETTIME within two minutes of the current System time and expects only an adjustment, a clock set may result if MOMI is also performing an adjustment.

 

 

Can this feature be activated even if the System time is off by more than several minutes?

 

Yes.  It may take weeks or months to finally arrive at the correct time, particularly if the System time is ahead of the Network Source.

 

 

How long do time adjustments take?

 

Adjusting the clock forward two minutes takes about 33 hours. Adjusting the clock back two minutes takes about 14 days.

 (information from the HP Knowledgebase)

 

 

Can an operator perform a SETTIME while MOMI is adjusting the System time?

 

Yes.  Take note of the first question above.  MOMI's time computation may be affected if the System time is externally set but the condition would self correct after a few automatic time updates.

 

 

Can I have another process (or method) also perform adjustments to the System time in addition to MOMI?

 

Not recommended. Only one process (or method) should be selected to maintain the System time.

 

 

Once the System time is correct and MOMI is performing adjustments, will the System time need to be manually set again?

 

Probably not.  The System time should be checked periodically by an operator to insure proper operation.  Messages are written to the MOMI Log and EMS Msgs log for normal and error conditions detected by MOMI (messages are described below).

 

After a maintenance window, particularly if the outage was extended or if any hardware was replaced, the System time should be checked after processors are loaded but before System is 'started'.

 

 

Will messages appear in my EMS log every hour (assuming MOMI is checking once an hour)?

 

Only if a time adjustment is required.

 

 Initially, you will see messages logged to EMS every hour while your System time is brought into sync.  Two messages are logged when a time adjustment occurs.  The first message notifies that MOMI is going to perform an adjustment.  The second message is from the Operating System indicating the time was adjusted (System ID: TANDEM.CLOCK, Message number 107).  Additionally, a message is also logged should the Operating System reject the attempt by MOMI to perform the time adjustment.    

 

 

MOMI logs the following messages

 

Normal messages

 

SNTP:System time n.nnnnnn seconds ahead of Network Source (<ip-address>)

SNTP:System time n.nnnnnn seconds behind Network Source (<ip-address>)

SNTP:System time 0.000000 seconds equal to Network Source (<ip-address>)

 

This message is written to the MOMI Log and reflects the difference between the NTP server and the Nonstop System.

 

 

SNTP:System time does not require adjustment by MOMI

 

This message is written to the MOMI Log and indicates that the required adjustment is below an internal threshold so MOMI does not perform any action to the System time.  

 

 

SNTP:System time will be adjusted by MOMI forward n.nnnnnn seconds

SNTP:System time will be adjusted by MOMI backward n.nnnnnn seconds

 

This message is written to the MOMI Log and EMS Msgs log prior to performing the adjustment to the System Clock. The operating system will also generate an EMS message when MOMI issues the call to adjust the System Clock.

 

 

Error messages

 

SNTP:Unable to open socket - TCP/IP stack $tcpip-name

 

This message is written to the MOMI LogEMS Msgs and log and indicates that the TCP/IP process specified in the CONFMOMI keyword SNTP-TCPIP-NAME was either invalid or not available.

 

 

SNTP:Unable to obtain TCP/IP address from <DNS-name> | <IP-address>

 

This message is written to the MOMI Log and EMS Msgs log and indicates that the NTP server specified in the CONFMOMI keyword SNTP-SERVER-ADDR was invalid or the DNS entry could not be converted to a binary address (like the Nonstop System did not have access to an DNS server).

 

 

SNTP:Unable to obtain reliable time from Network Source

 

This message is written to the MOMI Log and indicates that MOMI could not process the responses from the NTP server.  This either indicates a temporary condition, such as an extremely poor communications link or problems at the NTP server.  Occasional messages (particularly if the Internet connection is down) are expected.  

 

 

SNTP:MOMI failed to adjust System time

 

This message is written to the MOMI Log and EMS Msgs log and indicates that the call to adjust the System Clock failed.  MOMI requires the proper security for the MOMI helper program BWSSG to perform this activity.